import kNN
import matplotlib
import matplotlib.pyplot as plt
import numpy as np

datingDataMat, datingLabels = kNN.file2matrix('datingTestSet.txt')

fig = plt.figure()
ax = fig.add_subplot(111)
# 0:每年获得的飞行常客里程数  1：玩视频游戏所耗时间百分比  2:每周消费的冰淇淋公升数
#ax.scatter(datingDataMat[:,1], datingDataMat[:,2])
ax.scatter(datingDataMat[:,0], datingDataMat[:,1], 15.0 * np.array(datingLabels), 15.0 * np.array(datingLabels))
plt.savefig('scatter_plot_2.png')